package com;

import com.pojo.Dao;
import com.pojo.Shuigou;
import com.pojo.User;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;

//控制器

@Controller
public class Appmoc {
//    方法

    @RequestMapping("p1")
    public String mvc(String name,String pwd){
        System.out.println (name+pwd);
//        返回视图
return "index";
    }
    @RequestMapping("p4")
    public String all(Shuigou xian){
        System.out.println (xian);


        return"forward:p1";
    }
    @RequestMapping("P3")
    @ResponseBody
    public User qq( @RequestBody User xian)throws IOException {
        System.out.println (xian);
        return xian;
    }
}
